@echo off
rem Запускает текущий домен

set domain_dir=%1
if "%domain_dir%"=="" (set domain_dir=%~dp0)
IF %domain_dir:~-1%==\ SET domain_dir=%domain_dir:~0,-1%

for %%I in ("%domain_dir%") do set domain=%%~nI

if "%domain%"=="" (
	echo Domain name was not specified
	exit 1
)

echo Domain name is %domain%
echo Domain dir is %domain_dir%

set BIN_DIR=%domain_dir%\..\..\..\bin
echo Starting domain %domain%
call %BIN_DIR%\asadmin.bat start-domain %domain%

exit 0